package org.goldfish.spring_tutorial.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/")
public class RenderController {
    @Value("goldfish's ${spring.application.name}")
    String appName;

    @GetMapping
    public String render(Model model) {
        List<String> actions = List.of("gf", "wrr", "misaka");
        model.addAttribute("appName", appName);
        model.addAttribute("actions",actions);
        return "hello";
    }
}
